package com.iraeta.service.iraorder.impl;

import com.iraeta.dao.iraorder.IraorderproductDao;
import com.iraeta.entity.Iraorderproduct;
import com.iraeta.service.iraorder.IraorderproductService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class IraorderproductServiceImpl implements IraorderproductService {
    @Resource
    IraorderproductDao iraorderproductDao;

    @Override
    public void addIraorderproduct(Iraorderproduct iraorderproduct) {
        iraorderproductDao.insert(iraorderproduct);
    }

    @Override
    public void updateIraorderproduct(Iraorderproduct iraorderproduct) {
        iraorderproductDao.updateByPrimaryKey(iraorderproduct);
    }

    @Override
    public void deleteIraorderproduct(Integer id) {
        iraorderproductDao.deleteByPrimaryKey(id);
    }

    @Override
    public Iraorderproduct getIraorderproduct(Integer id) {
        return iraorderproductDao.selectByPrimaryKey(id);
    }

    @Override
    public List<Iraorderproduct> listIraorderproductByOrderId(Integer orderId) {
        return iraorderproductDao.selectByOrderId(orderId);
    }
}
